	<script type="text/javascript">
		Ext.BLANK_IMAGE_URL = "/ext-2.0-beta1/resources/images/default/s.gif";
		
		Ext.onReady(function() {
			var columns = [
				{ header: ENTITY_TYPE,  sortable: true, dataIndex: 'type',  renderer: entityType },
				{ header: ENTITY_NAME,  sortable: true, dataIndex: 'name' },
				{ header: ENTITY_URL,   sortable: true, dataIndex: 'url',   renderer: link },
				{ header: ENTITY_EMAIL, sortable: true, dataIndex: 'email', renderer: mail },
				{ header: ENTITY_PHONE, sortable: true, dataIndex: 'phone' },
				{ header: ENTITY_FAX,   sortable: true, dataIndex: 'fax' },
				{ header: CREATED_AT,   sortable: true, dataIndex: 'created_at', renderer: Ext.util.Format.dateRenderer() },
				{ header: UPDATED_AT,   sortable: true, dataIndex: 'updated_at', renderer: Ext.util.Format.dateRenderer() }
			];
			
			var viewport = new Ext.Viewport({
				layout: 'border',
				items: [{
					collapseMode: 'mini',
					collapsible: true,
					defaults: { border: false },
                    title: NAV_TITLE,
                    width: 200,
                    layout: 'accordion',
                    layoutConfig: { animate: true },
                    items: [
						{ title: NAV_RECORD },
						{ title: NAV_PLAN },
						{ title: NAV_STATS },
						{ title: NAV_DATA },
						{ title: NAV_TOOLS },
						{ title: NAV_PREFS }
					],
					margins: '5 0 5 5',
                    region: 'west',
					split: true,
					useSplitTips: true
				}, {
					activeItem: 0,
					frame: true,
					items: new Ext.TabPanel({
						activeTab: 0,
						defaults: { loadMask: true },
						items: [
							new Ext.grid.GridPanel({
								columns: columns,
								ds: new Ext.data.GroupingStore({
									autoLoad: true,
									groupField: 'type',
									reader: new Ext.data.XmlReader({ record: 'record' }, [ 'type', 'name', 'url', 'email', 'phone', 'fax', { name: 'created_at', type: 'date', dateFormat: 'Y-m-d H:i:s.u' }, { name: 'updated_at', type: 'date', dateFormat: 'Y-m-d H:i:s.u' } ]),
									sortInfo: { field: 'name' },
									url: 'entities.xml'
								}),
								title: ALL_ENTITIES,
								view: new Ext.grid.GroupingView({ forceFit: true, groupTextTpl: '{text} ({[values.rs.length]})' })
							}), new Ext.grid.GridPanel({
								columns: columns,
								ds: new Ext.data.Store({
									autoLoad: true,
									reader: new Ext.data.XmlReader({ record: 'record:has(type:nodeValue(Institution))' }, [ 'type', 'name', 'url', 'email', 'phone', 'fax', { name: 'created_at', type: 'date', dateFormat: 'Y-m-d H:i:s.u' }, { name: 'updated_at', type: 'date', dateFormat: 'Y-m-d H:i:s.u' } ]),
									url: 'entities.xml'
								}),
								title: INSTITUTIONS_ONLY
							}), new Ext.grid.GridPanel({
								columns: columns,
								ds: new Ext.data.JsonStore({
									autoLoad: true,
									fields: [ 'type', 'name', 'url', 'email', 'phone', 'fax', { name: 'created_at', type: 'date', dateFormat: 'Y-m-d H:i:s.u' }, { name: 'updated_at', type: 'date', dateFormat: 'Y-m-d H:i:s.u' } ],
									url: 'entities.xml'
								}),
								title: INDIVIDUALS_ONLY
							})
						],
						plain: true
					}),
					layout: 'card',
					margins: '5, 5, 5, 0',
					region: 'center',
					tools: [{
						id: 'help'
					}, {
						id: 'refresh'
					}, {
						id: 'close'
					}],
					title: "Listing Entities"
				}]
			});
		});
	</script>